$execute unless data storage dab:system gameRule[$(SG)] run return run data merge entity @s {text:'{"text":"???","color":"dark_gray"}'}

$execute store result score #ugud.bool temp run data get storage dab:system gameRule[$(SG)].switch
$execute if score #ugud.bool temp matches 0 run data modify entity @n[tag=UI-gamerule_control.ctr.TD,type=text_display,distance=..1] text set value '[{"text": "","color": "red"},{"nbt": "gameRule[$(SG)].display.name","storage": "dab:system","interpret": true}]'
$execute if score #ugud.bool temp matches 1 run data modify entity @n[tag=UI-gamerule_control.ctr.TD,type=text_display,distance=..1] text set value '[{"text": "","color": "green"},{"nbt": "gameRule[$(SG)].display.name","storage": "dab:system","interpret": true}]'

scoreboard players reset #ugud.bool temp